<template>
  <div class="excelIn">
    <el-card>
      <div slot="header"><span>导入表格</span></div>
      <UploadExcel :on-success="generateData"></UploadExcel>
      <el-table :data="tabList" border stripe style="width: 100%;margin-top: 30px;" >
        <el-table-column v-for="item in tabHeader" :prop="item" :key="item" :label="item" ></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import UploadExcel from '@/commont/plugins/uploadExcel'
export default {
  name: "excelIn",
  components: {UploadExcel},
  props: {},
  data () {
    return {
      tabList: [],
      tabHeader: []
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    generateData({ header, results }) {
      this.tabHeader = header
      this.tabList = results
    }
  },
  filters: {},
}
</script>

<style lang="less" scoped>
.excelIn {
  width: 100%;
  height: 100%;
  padding: 20px;
  background-color: #fff;
}
</style>